package com.sixetc.sixcontroller;

import com.sixetc.sixcontroller.slice.MainAbilitySlice;
import com.sixetc.sixcontroller.utils.LogUtil;
import ohos.aafwk.ability.Ability;
import ohos.aafwk.ability.IAbilityConnection;
import ohos.aafwk.ability.IAbilityContinuation;
import ohos.aafwk.content.Intent;
import ohos.aafwk.content.IntentParams;

public class MainAbility extends Ability implements IAbilityContinuation{
    private static final String TAG = MainAbility.class.getSimpleName();

    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setMainRoute(MainAbilitySlice.class.getName());
        LogUtil.info(TAG,"onStart");

        // 开发者显示声明需要使用的权限
        requestPermissionsFromUser(new String[]{"ohos.permission.DISTRIBUTED_DATASYNC"}, 0);
    }

    @Override
    protected void onStop() {
        super.onStop();
        LogUtil.info(TAG,"onStop");
    }

    @Override
    public boolean onStartContinuation() {
        LogUtil.info(TAG,"onStartContinuation");
        return false;
    }

    @Override
    public boolean onSaveData(IntentParams intentParams) {
        LogUtil.info(TAG,"onSaveData");
        return false;
    }

    @Override
    public boolean onRestoreData(IntentParams intentParams) {
        LogUtil.info(TAG,"onRestoreData");
        return false;
    }

    @Override
    public void onCompleteContinuation(int i) {
        LogUtil.info(TAG,"onCompleteContinuation: "+i);

    }

    @Override
    public void onRemoteTerminated() {
        LogUtil.info(TAG,"onRemoteTerminated");
    }

    @Override
    public void onFailedContinuation(int errorCode) {
        LogUtil.info(TAG,"onFailedContinuation");
    }
}
